/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.sbbs.axon.todo.handler;

import org.axonframework.eventhandling.EventHandler;
import org.sbbs.axon.todo.event.ToDoItemCompletedEvent;
import org.sbbs.axon.todo.event.ToDoItemCreatedEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ToDoEventHandler {

    Logger logger = LoggerFactory.getLogger(ToDoEventHandler.class);

    @EventHandler
    public void handle(ToDoItemCreatedEvent event) {
        logger.info("We've got something to do: " + event.getDescription() + " (" + event.getTodoId() + ")");
    }

    @EventHandler
    public void handle(ToDoItemCompletedEvent event) {
        logger.info("We've completed a task: " + event.getTodoId());
    }
}
